package com.easylinkin.linkappapi.personality.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 应用管理表
 * </p>
 *
 * @author XuGuoQing
 * @since 2020-05-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("linkapp_personality")
public class Personality extends Model<Personality> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId("id")
    private String id;

    /**
     * 个性化名称
     */
    @TableField("name")
    private String name;

    /**
     * 默认域名
     */
    @TableField("domin")
    private String domin;

    /**
     * 创建人id
     */
    @TableField("creator")
    private String creator;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;

    /**
     * 修改人id
     */
    @TableField("modifier")
    private String modifier;

    /**
     * 修改时间
     */
    @TableField("modify_time")
    private Date modifyTime;

    /**
     * 是否删除字段 0:已删; 1:存在
     */
    @TableField("delete_state")
    @TableLogic(value = "1", delval = "0")
    private Integer deleteState = 1;

    /**
     * 深色logo
     */
    @TableField(value = "deep_color_logo",strategy = FieldStrategy.IGNORED)
    private String deepColorLogo;

    /**
     * 浅颜色logo
     */
    @TableField(value = "light_color_logo",strategy = FieldStrategy.IGNORED)
    private String lightColorLogo;

    /**
     * 登录背景
     */
    @TableField(value = "login_back",strategy = FieldStrategy.IGNORED)
    private String loginBack;

    /**
     * 平台名称
     */
    @TableField("platform")
    private String platform;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    public boolean isAllEmpty() {
        return
                this.id == null &&
                        this.name == null &&
                        this.domin == null &&
//        this.creator ==null&&
//        this.createTime ==null&&
//        this.modifier ==null&&
//        this.modifyTime ==null&&
//        this.deleteState ==null&&
                        this.deepColorLogo == null &&
                        this.lightColorLogo == null &&
                        this.loginBack == null &&
                        this.platform == null;
    }

}
